﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.Hr;


namespace HengTong.ViewModel.Person.SysPersonMedicalVms
{
    public partial class SysPersonMedicalTemplateVm : BaseTemplateVM
    {
        [Display(Name = "员工")]
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysPersonMedical>(x => x.PersonId);
        [Display(Name = "体检批次表")]
        public ExcelPropety PersonMedicalBatcheExcel = ExcelPropety.CreateProperty<SysPersonMedical>(x => x.PersonMedicalBatcheId);
        [Display(Name = "体检结果")]
        public ExcelPropety ResultExcel = ExcelPropety.CreateProperty<SysPersonMedical>(x => x.Result);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
            PersonMedicalBatcheExcel.DataType = ColumnDataType.ComboBox;
            PersonMedicalBatcheExcel.ListItems = DC.Set<SysPersonMedicalBatche>().GetSelectListItems(Wtm, y => y.BatchName);
        }

    }

    public class SysPersonMedicalImportVm : BaseImportVM<SysPersonMedicalTemplateVm, SysPersonMedical>
    {

    }

}
